import request from "@/utils/request.js";
import Cache from "@/utils/cache.js"
const url = '/salesman'
/**
 * 我的会议申请分页条件查询
 */
export function salesManMeetingPage(data) {
  return request.post(url + `/salesManMeeting/page?pageSize=${data.pageSize}&pageNum=${data.pageNum}`, data);
}

/**
 * 我的会议申请分页条件查询
 */
export const createMeetPage = (data) => {
  return request.post(url + `/salesManMeeting/createMeetPage`, data)
}

/**
 * 获取当前登录的业务员的所有下级
 */
export const selectSalesMan = (data) => {
  return request.post(url + `/salesManMeeting/selectCSalesMan`, data)
}

/**
 * 发起会议
 */
export const createMeet = (data) => {
  return request.post(url + `/salesManMeeting/createMeet`, data)
}
/**
 * -修改自己的会议的签到校验模式 V
 */
export const updateMeetVerifyType = (data) => {
  return request.post(url + `/salesManMeeting/updateMeetVerifyType`, data)
}

/**
 * 获取报名id
 */
export const getSignUpIdByMeetId = (meetId) => {
  return request.get(url + `/SalesManMeetingSignUp/signIn/${meetId}`)
}

/**
 * 会议详情
 */
export const getMeetDetailByMeetId = (meetId) => {
  return request.get(url + `/salesManMeeting/infoWithMeetingAppoint/${meetId}`)
}

/**
 * 报名
 */
export const signUp = (meetId) => {
  return request.get(url + `/SalesManMeetingSignUp/signUpMeet/${meetId}`)
}

/**
 * 取消报名
 */
export const cancelSignUp = (signUpId) => {
  return request.get(url + `/SalesManMeetingSignUp/cancelSignUp/${signUpId}`)
}

/**
 * 签到表
 */
export const meetSignInPage = (params) => {
  return request.post(url + `/salesManMeetingSignIn/page`, params)
}

/**
 * 修改客户签名备注
 */
export const updateNote = (params) => {
  return request.put(url + `/salesManMeetingSignIn/update`, params)
}

/**
 * 审核会议详情
 */
export const getSalesManMeeting = (meetId) => {
  return request.get(url + `/salesManMeeting/info/${meetId}`)
}

/**
 * 审核会议申请 通过
 */
export const getCheckMeet = (meetId, checkState) => {
  return request.get(url + `/salesManMeeting/checkMeet/${meetId}/${checkState}`)
}

/**
 * 撤销会议
 */
export const revokeMeet = (meetId) => {
  return request.get(url + `/salesManMeeting/backMyMeet/${meetId}`)
}
// 修改会议
export function updateMeet(data) {
  return request.post(url + `/salesManMeeting/updateMeet`, data);
}
/**
 * 我的会议里面数据
 */
export function getCreateMeetPage(data) {
  return request.post(url + `/salesManMeeting/myMeetPage`, data);
}

/**
 * 获取当前登录的业务员的所有下级审核会议
 */
export const getSelectCSalesManMeet = (data) => {
  return request.post(url + `/salesManMeeting/selectCSalesManMeet`, data)
}

//    新版1219 我的会议

export function getMyMeetList(data) {
  return request.post(url + `/salesManMeeting/getMyMeetList`, data);
}
//  业务员小程序 - 查询会议列表（用于会议绑定） V-1.0.

export function forConferenceBinding(data) {
  return request.post(url + `/SalesManMeetingSignUp/inquiryClerkSignUpList
`, data);
}
export function salesManMeetingInfo(meetId) {
  return request.get(url + `/salesManMeeting/info/${meetId}`);
}
// 更新订单绑定的会议ID
export function updateOrderBindingMeet(data) {
  return request.post(url + `/order/updateOrderBindingMeet`, data);
}
// 1219可报名会议
export function getMyCanSignUpMeetList(data) {
  return request.post(url + `/salesManMeeting/getMyCanSignUpMeetList`, data);
}
// 1219历史会议
export function getHistoryMeetList(data) {
  return request.post(url + `/salesManMeeting/getHistoryMeetList`, data);
}
//   1219 据会议ID查询该会议报名的业务员列表
export function getHaveSignedUpForTheMeetListByMeetId(data) {
  return request.post(url + `/SalesManMeetingSignUp/getHaveSignedUpForTheMeetListByMeetId`, data);
}
//   1219 1219客户报名列表
export function listCustomerSignUp(data) {
  return request.post(url + `/customerSignUp/listCustomerSignUp`, data);
}
//   1219根据客户报名ID业务员添加或修改 客户报名记录的备注

export function salesManMeetingSignInUpdateNote(data) {
  return request.post(url + `/salesManMeetingSignIn/updateNote`, data);
}
// 业务员添加或修改 客户管理的备注
export function updateCustomerManger(data) {
  return request.post(url + `/salesManMeetingSignIn/updateCustomerManger`, data);
}
//  -1219根据会议ID查询该会议的客户签到列表

export function listSignInByMeetId(data) {
  return request.post(url + `/salesManMeetingSignIn/listSignInByMeetId`, data);
}

//分页查询该客户的领取记录
export function receiveListByuser(data) {
  return request.post(url + `/receiveSalesman/pageReceive`, data);
}
//业务员小程序 用户中心-购买记录 传客户id
export function purchaseListByuser(data) {
  return request.post(url + `/customerCentre/getOrderList`, data);
}
//根据客户的ID分页查询客户的历史签到记录与其报名会议列表-客户id放在salesmanId字段内
export function meetListByuser(data) {
  return request.post(url + `/customerCentre/getHistoryMeetByCustomerId`, data);
}
//业务员小程序 根据客户管理表ID修改 对应客户管理的星级
export function updateCustomerStarByManageId(data) {
  return request.post(url + `/customerCentre/updateCustomerStarByManageId`, data);
}
//业务员小程序 请求权益卡平台 获取手机号对应的用户的开卡记录
export const cardListByuser = (phone) => {
  return request.get(url + `/customerCentre/toEquityForActivateCard/${phone}`)
}
//业务员小程序 请求权益卡平台 获取手机号对应的用户的开卡记录
export const cardDetailByuser = (cardNum) => {
  return request.get(url + `/customerCentre/equityCardQueryInfoForCow/${cardNum}`)
}

//业务员小程序 请求健康平台 获取手机号对应的用户的服务记录
export const serviceListByuser = (phone) => {
  return request.get(url + `/customerCentre/toHealthForServiceLog/${phone}`)
}

//业务员发起抽奖
export function launchALuckyDraw(data) {
  return request.post(url + `/prize_draw/launchALuckyDraw`, data);
}

//抽奖
export const drawALottery = (prizeDrawId) => {
  return request.get(url + `/prize_draw/drawALottery/${prizeDrawId}`)
}

//业务员开始抽奖
export const startTheDraw = (prizeDrawId) => {
  return request.get(url + `/prize_draw/startTheDraw/${prizeDrawId}`)
}